#ifndef CSerialReader_HPP
#define CSerialReader_HPP

// System includes

// Other includes
#include "CSerialPort.hpp"
#include "CObservable.hpp"

class CCommand;
class CObserver;

class CSerialReader : public CObservable
{
public:
   /**
    * @brief Constructor
    * @param device Device name
    */
   CSerialReader(const char* device, CObserver* pObserver);

   /**
    * @brief Starts server:
    *        Opens device and starts reading commands from it
    */
   void start();

   void sendCommand(CCommand cmd);

   bool isConnected();
   
   void initSerialPort();
   
   ~CSerialReader();
protected:

private:
   const char* mDevice;
   CSerialPort* mpSerial;
};

#endif // CSerialReader_HPP